package com.fept.msgcore.scheduler.job.impl;

import com.fept.msgcore.scheduler.job.base.NonConcurrentScheduleJob;
import com.fept.msgcore.scheduler.job.manager.ScheduleManager;
import org.quartz.SchedulerException;

import java.util.List;

/**
 * Created by Srma on 2/10/2017.
 */
public class ScheduleManagerJob extends NonConcurrentScheduleJob {
    public ScheduleManagerJob() {
    }

    public String getTimeExpression() {
        return "0 0/5 * * * ?";
    }

    public void process() throws SchedulerException {
        List jobs = ScheduleManager.getInstance().listCurrentlyExecutingJobs();
        if(jobs == null) {
            logger.info("ScheduleManagerJob: no job in processing");
        } else {
            logger.info(jobs.size() + " jobs in processing");
        }
    }
}
